{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "      *\n",
      "     ***\n",
      "    *****\n",
      "   *******\n",
      "  *********\n",
      " ***********\n",
      "*************\n",
      "     **\n",
      "     **\n"
     ]
    }
   ],
   "source": [
    "def print_tree(height):\n",
    "    for i in range(height):\n",
    "        print(' ' * (height - i - 1) + '*' * (2 * i + 1)) \n",
    "    trunk_width = height // 3\n",
    "    trunk_height = height // 3\n",
    "    trunk_space = (height - trunk_width) // 1\n",
    "    for i in range(trunk_height):\n",
    "        print(' ' * trunk_space + '*' * trunk_width)\n",
    "print_tree(7)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.0"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
